package com.yfp.client.mapper;

import com.yfp.client.domain.MallOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.client.domain.MallOrderDetails;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 * @description 针对表【mall_order(商城订单)】的数据库操作Mapper
 * @createDate 2025-03-05 10:54:48
 * @Entity com.yfp.client.domain.MallOrder
 */
public interface MallOrderMapper extends BaseMapper<MallOrder> {

    /**
     * 更新预支付id
     *
     * @param id
     * @param wxPrepayId
     */
    void updatePrepayIdById(@Param("id") Long id, @Param("wxPrepayId") String wxPrepayId);

    /**
     * 根据订单号查询订单
     *
     * @param orderSn
     * @return
     */
    MallOrder getByOrderSn(String orderSn);

    /**
     * 根据用户id和订单状态查询订单
     *
     * @param clientId
     * @param statusList
     * @return
     */
    List<MallOrder> listByClientIdAndStatusIds(@Param("clientId") String clientId, @Param("statusList") List<Integer> statusList);

    /**
     * 修改订单状态
     * @param orderSn
     * @param status
     */
    void updateStatus(@Param("orderSn") String orderSn, @Param("status") Integer status);

    /**
     * 根据订单号获取订单详情信息
     * @param orderSn
     * @return
     */
    MallOrderDetails orderSnGetDetail(String orderSn);
}




